package com.lsh.airticket.controller;

import com.lsh.airticket.dto.Result;
import com.lsh.airticket.entity.City;
import com.lsh.airticket.service.CityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author lsh
 * @date 2021/2/15
 **/
@RestController
@RequestMapping("flights")
public class CityController {

    @Autowired
    CityService cityService;

    @GetMapping("/city/findAllCity")
    public Result findAllCity() {
        List<City> cities = cityService.findAllCity();
        return Result.result().addData("cities", cities).setMsg("查询成功");
    }
}
